package com.wsj.a.iconandtextdemo.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.View;

import com.wsj.a.iconandtextdemo.R;

/**
 * created on 2018/10/22 11:52.
 *
 * @author linxiujie
 */
public class BaseActivity extends FragmentActivity {

    private String clsName;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setClsName(this.getClass());
    }

    @Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        //标题头部返回按键的点击结束
        View view = findViewById(R.id.toolbar_back);
        if (view != null) {
            view.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    finish();
                }
            });
        }
    }

    public void setClsName(Class cls){
        this.clsName = cls.getSimpleName();
    }
}
